// JavaScript Document\
$(document).ready(function () {

    // wow
    if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
        new WOW().init();
    };
    // banner轮播

    var a = $(".banner .swiper-container .swiper-slide").length;

    $(".lb-num .total-num").text(a);

    var swiper = new Swiper('.banner .swiper-container', {
        speed: 3000,
        // parallax: true,
        autoplay: {
            delay: 3000,
            disableOnInteraction: false,
        },
        loop: false,
        watchOverflow: true,
        resistanceRatio: 0,
        pagination: {
            el: '.banner .swiper-pagination',
            type: 'progressbar',
        },

        on: {
            slideChange: function () {
                $(".lb-num .jd-num").text(this.activeIndex + 1 < 10 ? "0" + (this.activeIndex + 1) : this.activeIndex + 1);
                $(".lb-num .cur-num").text(this.activeIndex + 1);



            },



        }

    });

    //phone-nav
    $('.menuBtn').append('<b></b><b></b><b></b>');
    $(".menuBtn").click(function () {
        $('body').toggleClass('fixme');
        $(".header .nav").slideToggle(400);
    });
    $(".header .nav ul li").click(function () {
        $(this).find(".menu").slideToggle(300).parents("li").siblings().find(".menu").slideUp(300);

    })



    // index parter

    $(function () {
        var c = $(".index-partner");
        c.find(".tab").each(function (e) {
            $(this).hover(function () {
                c.find(".tab").removeClass("active"), $(this).addClass("active"),
                    c.find(".panel").removeClass("active").eq(e).addClass("active"),
                    c.find(".line").css({
                        marginLeft: 130 * e + 30
                    })
            })
        })
    });

    $(function () {
        var c = $(".index-partner");
        c.find(".tab").each(function (e) {
            $(this).click(function () {
                c.find(".tab").removeClass("active"), $(this).addClass("active"),
                    c.find(".panel").removeClass("active").eq(e).addClass("active"),
                    c.find(".line").css({
                        marginLeft: 130 * e + 30
                    })
            })
        })
    });

    // 服务理念
    $(".fwln-list li").on("mouseover", function () {
        $(this).addClass("active").siblings().removeClass("active");

    })

    $(".fwln-list li").on("click", function () {
        $(this).addClass("active").siblings().removeClass("active");

    })



    // 合作案例
    var swiper = new Swiper('.case-sec .swiper-container', {
        slidesPerView: 3,
        spaceBetween: 60,
        speed: 3000,
        // parallax: true,
        watchOverflow: true,
        resistanceRatio: 0,
        autoplay: {
            delay: 3000,
            disableOnInteraction: false,
        },
        // init: false,
        pagination: {
            el: '.case-sec .swiper-pagination',
            clickable: true,
        },
        breakpoints: {
            1024: {
                slidesPerView: 3,
                spaceBetween: 40,
            },
            768: {
                slidesPerView: 2,
                spaceBetween: 30,
            },
            640: {
                slidesPerView: 1,
                spaceBetween: 10,
            },

        }
    });




    // 服务体系
    var swiper = new Swiper('.service-sec .swiper-container', {
        slidesPerView: 6,
        spaceBetween: 0,
        speed: 3000,
        // parallax: true,
        watchOverflow: true,
        resistanceRatio: 0,
        autoplay: {
            delay: 3000,
            disableOnInteraction: false,
        },
        // init: false,
        pagination: {
            el: '.service-sec .swiper-pagination',
            clickable: true,
        },
        breakpoints: {
            1600: {
                slidesPerView: 5,
                spaceBetween: 40,
            },
            1400: {
                slidesPerView: 4,
                spaceBetween: 30,
            },
            640: {
                slidesPerView: 2,
                spaceBetween: 20,
            },
            320: {
                slidesPerView: 1,
                spaceBetween: 10,
            }
        }
    });


    // 善待核心
    var swiper = new Swiper('.core-sec .swiper-container', {
        slidesPerView: 4,
        spaceBetween: 50,
        speed: 3000,
        // parallax: true,
        watchOverflow: true,
        resistanceRatio: 0,
        autoplay: {
            delay: 3000,
            disableOnInteraction: false,
        },
        // init: false,
        pagination: {
            el: '.core-sec .swiper-pagination',
            clickable: true,
        },
        breakpoints: {
            1200: {
                slidesPerView: 3,
                spaceBetween: 40,
            },
            768: {
                slidesPerView: 2,
                spaceBetween: 30,
            },
            640: {
                slidesPerView: 1,
                spaceBetween: 20,
            },

        }
    });

    // 城市合伙人


    var swiper = new Swiper('.city-sec .swiper-container', {
        slidesPerView: 4,
        slidesPerColumn: 2,
        spaceBetween: 50,
        speed: 2000,
        // parallax: true,
        watchOverflow: true,
        resistanceRatio: 0,
        autoplay: {
            delay: 2000,
            disableOnInteraction: false,
        },
        pagination: {
            el: '.city-sec .swiper-pagination',
            clickable: true,
        },
        breakpoints: {
            1500: {
                slidesPerView: 3,
                spaceBetween: 40,
            },
            1200: {
                slidesPerView: 2,
                spaceBetween: 30,
            },
            640: {
                slidesPerView: 1,
                spaceBetween: 10,
            },

        }

    });





    //百度分享
    var url = '';

    function seturl(a) {
        url = a
    }
    window._bd_share_config = {
        common: {
            bdText: '自定义分享内容',
            bdDesc: '自定义分享摘要',
            bdUrl: '自定义分享url地址',
            bdPic: '自定义分享图片',
            onBeforeClick: function (cmd, config) {
                return {
                    bdUrl: url
                }
            }
        },
        share: [{

        }],
        // slide: [{
        //         bdText: '333333333333'
        //     }

        // ],

        // selectShare: [{

        // }]
    }
    with(document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion=' + ~(-new Date() / 36e5)];

});